package com.lxlg.lxlg_order.client;

import com.lxlg.core.utils.Result;
import com.lxlg.lxlg_order.client.param.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;


/**
 * name是项目名，contextId是client的名字
 */
@FeignClient(contextId = "formGoodOrderClient",name="orderservice")
@RequestMapping("/orderservice/infra/goods-order")
public interface FormGoodOrderClient {

    @PostMapping("newFormOrder")
    @ApiOperation("新增订单")
    public Result<String> newFormOrder(@Valid @RequestBody FormOrderForm formOrderForm);

    @PostMapping("payFormOrder")
    @ApiOperation("支付订单")
    public void payFormOrder(@Valid @RequestBody FormOrderPayFOrm formOrderPayFOrm, HttpServletResponse resp) throws IOException;

    @PostMapping("cancleFormOrder")
    @ApiOperation("取消订单")
    public Result<String> cancleFormOrder(@Valid @RequestBody CancleFormOrderForm cancleFormOrderForm);

    @PostMapping("delivergoods")
    @ApiOperation("投递生成物流信息")
    public Result<String> deliverGoods(@Valid @RequestBody DeliverGoodsForm deliverGoodsForm);

    @PostMapping("changedeliverGoodsState")
    @ApiOperation("物流公司修改物流状态")
    public Result<String> changedeliverGoodsStateBycompany(@Valid @RequestBody LogisticsStateForm logisticsStateForm );



}
